﻿@model Von.Web.Models.HtmlContentModel
@{
    ViewData["Title"] = Model.Title;
    ViewData["keywords"] = Model.Autor;
    ViewData["tags"] = "";
    ViewData["description"] = Model.Summary;
}
<div>
    <span style="font-size:32px;font-weight:600;">@Model.Title</span>
    @if (ViewBag.displayAuthorInfo)
    {<span style="font-size:20px;">作者：@Model.Autor</span>}
</div>
@Html.Import(Von.Web.Html.EImportSection.BodyHeader, "font-awesome_css", @<link rel="stylesheet" type="text/css" href="~/css/font-awesome.min.css" />)
@Html.Import(Von.Web.Html.EImportSection.BodyHeader, "share_css", @<link rel="stylesheet" type="text/css" href="~/lib/share/css/share.min.css" />)
@Html.Import(Von.Web.Html.EImportSection.BodyTrailler, "share_js", @<script src="/lib/share/js/jquery.share.min.js"></script>)
@if (ViewBag.displayPublishedInfo || ViewBag.displaySourceInfo || ViewBag.displayFontInfo || ViewBag.displayShareInfo)
{
    <div class="top-bar ani" id='top_bar' data-font-size="18">
        <div class="top-bar-inner">
            <div class="top-bar-left">
                @if (ViewBag.displayPublishedInfo)
                {<span class="date">@Model.Publishedate.ToString("D")</span>}
                @if (ViewBag.displaySourceInfo)
                {<a href="@Model.Linker" target="_blank" class="source" data-sudaclick="content_media_p" rel="nofollow">@Model.Src</a>}
            </div>
            <div class="top-bar-right">
                @if (ViewBag.displayFontInfo)
                {
                    <span class="tool-icon tool-smallerfont"><a onclick="smallerfont(this);" title="缩小字体" class="ani">缩小字体</a></span>
                    <span class="tool-icon tool-enlargedfont"><a onclick="enlargedfont(this);" title="放大字体">放大字体</a></span>
                    <span class="tool-icon tool-favorite"><a onclick="favorite(this);" title="收藏本页">收藏</a></span>
                }
                @if (ViewBag.displayShareInfo)
                {
                    <div class="btn-group">
                        <span class="tool-icon tool-share" data-toggle="dropdown"><a title="分享">分享</a></span>
                        <ul class="dropdown-menu" role="menu"><li><div id="share"></div></li></ul>
                    </div>
                }
            </div>
        </div>
    </div>
}
@if (ViewBag.displaySummaryInfo)
{
    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="fa fa-info-circle">内容摘要</i>
        </div>
        <div class="panel-body">
            @Model.Summary
        </div>
    </div>
}
<div id="news_style_article">
    @Html.Raw(Model.Content)
</div>
@if (ViewBag.displayCommentInfo)
{
    @Html.Partial("/Views/Shared/_CommentModule.cshtml", new Von.Web.Models.CommentPartialModel()
    {
        Kind = "系统文档",
        Linker = Context.Request.Path.ToString(),
        Summary = Model.Title,
        Style = new ECommentStyle[] { ECommentStyle.支持反对, ECommentStyle.支持回复, ECommentStyle.支持头像, ECommentStyle.支持评分, ECommentStyle.支持评论列表, ECommentStyle.支持赞成 }
    })
}
<script>
function smallerfont(btn) {
    var size = $("#top_bar").attr("data-font-size") - 2;
    if (size < 8) return;
        $("#news_style_article").css("font-size", size + "px");
        $("#top_bar").attr("data-font-size", size);
}
function enlargedfont(btn) {
    var size = parseInt($("#top_bar").attr("data-font-size")) + 2;
        $("#news_style_article").css("font-size", size + "px");
        $("#top_bar").attr("data-font-size", size);
}
function favorite(btn) {
    try { window.external.addFavorite(parent.location.href, '@Model.HtmlName'); }
    catch (e) {
        try { window.sidebar.addPanel('@Model.HtmlName', parent.location.href, "@Model.Title"); }
        catch (e) { alert("您可以尝试通过快捷键 ctrl+D 加入到收藏夹！"); }
    }
}
    </script>
    @Html.Import(Von.Web.Html.EImportSection.BodyTrailler, "HtmlCatalogInit",
        @<script>
             $('#share').share();
        </script>
)
